<?php $this->load->view('common/header'); ?>
<?php $this->load->view('common/menu'); ?>


    <div class="product_list">
        <div class="title">
            <?php if ($category) : ?>
                <?php foreach ($category as $key => $val) : ?>
                    <a href="<?php echo "/product/" . $val['id'] . ".html"; ?>" <? if (isset($id) && $id == $val['id']) { ?> class="on" <?php } ?> ><?php echo $val['category_name'] ?? ""; ?></a>
                <?php endforeach; ?>
            <?php endif; ?>
        </div>
        <div class="list">
            <ul>
                <?php if ($products) : ?>
                    <?php foreach ($products as $key => $val) : ?>
                            <li>
                                <a href="<?php echo "/product_show/" . $val['id'] . ".html"; ?>">
                                    <img src="<?php echo $val['img'] ?? ""; ?>" style="width: 400px;height: 302px">
                                    <span>
                                    <?php echo $val['title']; ?><em></em>
                                </span>
                                </a>
                            </li>
                    <?php endforeach; ?>
                <?php endif; ?>

            </ul>
        </div>
        <div class="page">
            <ul><?php echo $pagination; ?></ul>
        </div>
    </div>
    <br>

<?php $this->load->view('common/footer'); ?>